:root {
    --kt-primary: #FF5733;
    --kt-secondary: #E4E6EF;
    --kt-success: #5DC471;
    --kt-info: #ff856b;
    --kt-warning: #F9A602;
    --kt-danger: #E12929;
    --kt-dark: #181C32;
    --kt-primary-active: #FF4820;
    --kt-secondary-active: #B5B5C3;
    --kt-light-active: #eff2f5;
    --kt-success-active: #47BE7D;
    --kt-info-active: #5014D0;
    --kt-warning-active: #F1BC00;
    --kt-danger-active: #D9214E;
    --kt-dark-active: #131628;
    --kt-primary-light: #FEE9E1;
    --kt-secondary-light: #f5f8fa;
    --kt-success-light: #E9FFE5;
    --kt-info-light: #E5F5FF;
    --kt-warning-light: #FFFBD5;
    --kt-danger-light: #FFE5E5;
    --kt-dark-light: #eff2f5;
    --kt-primary-inverse: #ffffff;
    --kt-secondary-inverse: #3F4254;
    --kt-light-inverse: #7E8299;
    --kt-success-inverse: #ffffff;
    --kt-info-inverse: #ffffff;
    --kt-warning-inverse: #ffffff;
    --kt-danger-inverse: #ffffff;
    --kt-dark-inverse: #ffffff;
}


.hidden {
    display: none;
}

.table-responsive {
    width: 100%;
}

tfoot .row {
    margin-left: 0;
    margin-right: 0;
}

.menu-hover {
    transition: color 0.2s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-link:hover {
    transition: color 0.2s ease;
    background-color: rgba(199, 199, 199, 0.3) !important;
}

.pointer,
input[type="checkbox"] {
    cursor: pointer !important;
}

.card-history .options {
    padding: 8px 5px 0 0;
    text-align: right;
    width: 100%;
    position: absolute;
    z-index: 15;
    top: 0;
}

.card-history .symbol .symbol-label {
    background-color: #333 !important;
}

.card-history .options a {
    margin-left: 5px;
}


.card-history .address,
.table-history .address {
    white-space: nowrap;
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
}


.card-history.card {
    box-shadow: 0px 5px 6px 2px #7e7e7e98;
    margin-left: 20px;
}

.card-history.card:hover {
    background-color: #eee;
    cursor: pointer;
}

.card-history .card-header {
    padding: 10px 15px 0 0px;
    min-height: 40px;
    justify-content: flex-end;
}

.card-history .card-body {
    padding-top: 40px !important;
    min-height: 160px;
}

.card-history::before {
    position: absolute;
    top: 34px;
    left: -20px;
    content: '';
    background: #131a4a;
    height: 15px;
    width: 20px;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.card-history img,
.modal-body img {
    max-width: 100%;
}

.modal-body iframe {
    width: 100%;
    min-height: 300px;
}

.card-history::after {
    position: absolute;
    content: attr(data-label);
    top: 7px;
    left: -20px;
    padding: 4px 20px;
    width: auto;
    background: #3949ab;
    color: white;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    box-shadow: 4px 4px 15px rgba(26, 35, 126, 0.2);
    border-radius: 10px;
    border-top-left-radius: initial;
    border-bottom-left-radius: initial;
    z-index: 10;
}

.card-danger {
    background-color: #f75555;
}

.card-orange::after {
    background-color: rgb(204, 127, 27);
}

.card-orange::before {
    background-color: rgb(122, 76, 15);
}


.card-green::after {
    background-color: rgb(29, 90, 1);
}

.card-green::before {
    background-color: rgb(19, 49, 6);
}


.card-red::after {
    background-color: rgb(182, 0, 0);
}

.card-red::before {
    background-color: rgb(136, 0, 0);
}


.card-silver::after {
    background-color: rgb(184, 184, 184);
    color: rgb(54, 54, 54);
}

.card-silver::before {
    background-color: rgb(151, 143, 133);
}


.card-purple::after {
    background-color: rgb(202, 22, 121)
}

.card-purple::before {
    background-color: rgb(128, 8, 74)
}



.card-blue::after {
    background-color: rgb(23 133 193)
}

.card-blue::before {
    background-color: rgb(11, 46, 65)
}

div.dataTables_wrapper div.dataTables_processing {
    position: absolute;
    background: #f58732;
    color: #FFF;
    top: 30px;
    left: 50%;
}

.form-check-custom .form-check-label {
    width: max-content;
}

.form-check-label {
    color: var(--kt-form-check-label-color-checked);
}

.form-check-input:checked+span,
.form-check-input:checked+label {
    color: var(--kt-form-check-label-color-checked);
    font-weight: bold;
}



a.badge:hover {
    color: #fff;
}

a.badge.badge-light-danger:hover:hover {
    background-color: var(--kt-danger);
    color: #FFF;
}

a.badge.badge-light-danger:hover:hover>.img-arr097 {
    background: #FFF;
}

.img-ico {
    margin-top: 6px;
    width: 18px;
    height: 18px;
    display: inline-block;
}

.badge-light-danger:hover {
    background-color: var(--kt-danger-light);
}

.img-arr097 {
    margin: 0px !important;
    background: var(--kt-danger);
    -webkit-mask: url("../../../assets/media/icons/duotune/arrows/arr097.svg") center/contain;
    mask: url("../../../assets/media/icons/duotune/arrows/arr097.svg") center/contain;
}

.img-gen037 {
    margin: 0px 5px 0px 0px !important;
    background: #fff;
    -webkit-mask: url("../../../assets/media/icons/duotune/general/gen037.svg") center/contain;
    mask: url("../../../assets/media/icons/duotune/general/gen037.svg") center/contain;
}

.img-gen015 {
    background: gray;
    -webkit-mask: url("../../../assets/media/icons/duotune/general/gen015.svg") center/contain;
    mask: url("../../../assets/media/icons/duotune/general/gen015.svg") center/contain;
}

.img-gen018 {
    background: #ff5722;
    -webkit-mask: url("../../../assets/media/icons/duotune/general/gen018.svg") center/contain;
    mask: url("../../../assets/media/icons/duotune/general/gen018.svg") center/contain;
}

.img-ico-orange {
    background: #ff5722;
}

.img-ico-blue {
    background: blue;
}

.img-ico-green {
    background: green;
}

.img-ico-purple {
    background: purple;
}

.table-history .img-ico {
    margin: 2px 6px 0 0 !important;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Gestor de Entregas — contraste alto (light + dark) */
.table-history #kt_datatable_history {
    --trip-history-text: #1a1d21;
    --trip-history-text-muted: #5c6570;
    --trip-history-head: #3f4254;
    --trip-history-head-bg: #f1f3f6;
    --trip-history-row-hover: #f4f6f9;
}

[data-theme="dark"] .table-history #kt_datatable_history {
    --trip-history-text: #f1f3f5;
    --trip-history-text-muted: #c5cdd6;
    --trip-history-head: #ffffff;
    --trip-history-head-bg: rgba(255, 255, 255, 0.08);
    --trip-history-row-hover: rgba(255, 255, 255, 0.06);
}

.table-history .trip-history-thead th {
    color: var(--trip-history-head) !important;
    background-color: var(--trip-history-head-bg) !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.9rem 0.75rem !important;
    border-bottom: 1px solid var(--kt-border-color) !important;
}

/* Sobrescreve text-gray-* / text-muted do DataTables e do tema */
.table-history #kt_datatable_history tbody td,
.table-history #kt_datatable_history tbody td .trip-history-code,
.table-history #kt_datatable_history tbody td .trip-history-date,
.table-history #kt_datatable_history tbody td .trip-history-metric,
.table-history #kt_datatable_history tbody td .trip-history-address,
.table-history #kt_datatable_history tbody td .trip-history-address--dest,
.table-history #kt_datatable_history tbody td .trip-history-driver-name {
    color: var(--trip-history-text) !important;
}

.table-history #kt_datatable_history tbody td {
    font-size: 0.925rem !important;
    line-height: 1.5;
    vertical-align: middle !important;
    padding: 0.9rem 0.75rem !important;
}

.table-history .trip-history-code {
    font-size: 1rem !important;
    font-weight: 700 !important;
}

.table-history .trip-history-date {
    font-weight: 600 !important;
    display: inline-block;
}

.table-history .trip-history-time,
.table-history #kt_datatable_history tbody td .text-muted {
    color: var(--trip-history-text-muted) !important;
    font-size: 0.875rem !important;
    opacity: 1 !important;
}

.table-history .trip-history-metric {
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    white-space: nowrap;
}

.table-history .trip-history-address {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    line-height: 1.45;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: block;
    max-width: 340px;
}

.table-history .trip-history-address--source {
    color: var(--trip-history-text-muted) !important;
    font-weight: 400 !important;
}

.table-history .trip-history-address--dest {
    font-weight: 700 !important;
}

.table-history .trip-history-routes-total,
.table-history .trip-history-routes-total strong {
    margin-top: 0.4rem;
    font-size: 0.85rem !important;
    color: var(--trip-history-text-muted) !important;
    opacity: 1 !important;
}

.table-history .trip-history-routes-total strong {
    color: var(--trip-history-text) !important;
    font-weight: 700 !important;
}

/* Badges de status no dark */
[data-theme="dark"] .table-history .badge-light-success {
    background-color: rgba(34, 197, 94, 0.22) !important;
    color: #86efac !important;
}

[data-theme="dark"] .table-history .badge-light-danger {
    background-color: rgba(239, 68, 68, 0.22) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .table-history .badge-light-info {
    background-color: rgba(56, 152, 236, 0.22) !important;
    color: #93c5fd !important;
}

.table-history .trip-history-col-routes {
    min-width: 260px;
}

.table-history .trip-history-driver {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.table-history .trip-history-driver-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--kt-gray-200);
    border: 2px solid var(--kt-border-color);
}

[data-theme="dark"] .table-history .trip-history-driver-avatar {
    background-color: var(--kt-gray-700);
}

.table-history .trip-history-driver-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.table-history .trip-history-driver-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--trip-history-text);
    line-height: 1.3;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-history #kt_datatable_history tbody tr:hover td {
    background-color: var(--trip-history-row-hover);
}

/* Modal — detalhes da entrega (#modalTripView) */
#modalTripView .trip-view-detail,
#modalTripView .modal-body-content {
    --trip-view-text: #1a1d21;
    --trip-view-text-muted: #5c6570;
    --trip-view-border: rgba(63, 66, 84, 0.35);
    --trip-view-note-bg: #f4f6f9;
    --trip-view-stat-label: #5c6570;
}

[data-theme="dark"] #modalTripView .trip-view-detail,
[data-theme="dark"] #modalTripView .modal-body-content {
    --trip-view-text: #f1f3f5;
    --trip-view-text-muted: #c5cdd6;
    --trip-view-border: rgba(255, 255, 255, 0.2);
    --trip-view-note-bg: rgba(255, 255, 255, 0.08);
    --trip-view-stat-label: #c5cdd6;
}

#modalTripView .trip-view-subtitle {
    color: var(--trip-view-text-muted) !important;
}

#modalTripView .modal-body > .text-center h1 {
    color: var(--trip-view-text, inherit);
}

#modalTripView .trip-view-section-title {
    color: var(--trip-view-text);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

#modalTripView .trip-view-address {
    color: var(--trip-view-text) !important;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
}

#modalTripView .trip-view-address--source {
    color: var(--trip-view-text-muted) !important;
    font-weight: 500;
}

#modalTripView .trip-view-route--dest .trip-view-address {
    font-weight: 700;
}

#modalTripView .trip-view-routes .img-ico {
    margin: 2px 10px 0 0 !important;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

#modalTripView .trip-view-route {
    gap: 0.25rem;
}

#modalTripView .trip-view-route-note {
    color: var(--trip-view-text) !important;
    background: var(--trip-view-note-bg) !important;
    border-color: var(--trip-view-border) !important;
}

#modalTripView .trip-view-driver-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
}

#modalTripView .trip-view-driver-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#modalTripView .trip-view-driver-name {
    color: var(--trip-view-text);
    font-weight: 700;
    font-size: 1.05rem;
}

#modalTripView .trip-view-driver-id {
    color: var(--trip-view-text-muted);
    font-style: normal;
    font-size: 0.85rem;
}

#modalTripView .trip-view-driver-info a {
    color: #25d366;
    font-weight: 600;
}

#modalTripView .trip-view-stat {
    border-color: var(--trip-view-border) !important;
    color: var(--trip-view-stat-label) !important;
}

#modalTripView .trip-view-stat-value {
    color: var(--trip-view-text) !important;
}

#modalTripView .trip-view-notes {
    color: var(--trip-view-text);
    line-height: 1.5;
}

[data-theme="dark"] #modalTripView .badge-light-success {
    color: #1a1d21 !important;
}

[data-theme="dark"] #modalTripView .badge-light-danger {
    color: #fff !important;
}

[data-theme="dark"] #modalTripView .badge-light-info {
    color: #1a1d21 !important;
}

/* Webapp — fundo suave (paleta cinza, sem branco puro no conteúdo) */
html:not([data-theme="dark"]) {
    --ryd-page-bg: #cfd4dc;
    --ryd-surface-card: #e6e9ef;
    --ryd-surface-muted: #dce0e7;
    --ryd-surface-inner: #e2e6ed;
    --ryd-text-muted: #5c6570;
    --ryd-border: rgba(24, 28, 50, 0.1);
    --kt-page-bg: var(--ryd-page-bg);
    --kt-secondary-light: var(--ryd-surface-muted);
    --kt-light-active: #d8dde5;
    --bs-gray-100: var(--ryd-surface-muted);
    --bs-gray-200: #d0d5dd;
    --bs-border-color: var(--ryd-border);
}

html:not([data-theme="dark"]) body,
html:not([data-theme="dark"]) .page-bg {
    background-color: var(--ryd-page-bg) !important;
}

html:not([data-theme="dark"]) #kt_wrapper .wrapper,
html:not([data-theme="dark"]) #kt_content_container,
html:not([data-theme="dark"]) #kt_content_container .content {
    background-color: transparent;
}

html:not([data-theme="dark"]) #kt_wrapper .card.card-flush,
html:not([data-theme="dark"]) #kt_content_container .card:not(.card-history) {
    background-color: var(--ryd-surface-card);
    border: 1px solid var(--ryd-border);
    box-shadow: 0 2px 10px rgba(22, 28, 45, 0.07);
}

html:not([data-theme="dark"]) .card.card-dashed {
    background-color: var(--ryd-surface-inner);
    border-color: var(--ryd-border) !important;
}

html:not([data-theme="dark"]) .form-control.form-control-solid,
html:not([data-theme="dark"]) .form-select.form-select-solid {
    background-color: var(--ryd-surface-muted) !important;
    border-color: var(--ryd-border) !important;
    color: #3f4254;
}

html:not([data-theme="dark"]) #kt_wrapper .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(24, 28, 50, 0.03);
    --bs-table-hover-bg: rgba(24, 28, 50, 0.05);
    --bs-table-border-color: var(--ryd-border);
}

html:not([data-theme="dark"]) #kt_wrapper .table thead th {
    background-color: var(--ryd-surface-muted) !important;
    color: var(--ryd-text-muted) !important;
    border-bottom-color: var(--ryd-border) !important;
}

html:not([data-theme="dark"]) #kt_wrapper .table tbody td {
    background-color: transparent;
    color: #3f4254;
    border-bottom-color: var(--ryd-border);
}

html:not([data-theme="dark"]) #kt_wrapper .table tfoot td,
html:not([data-theme="dark"]) #kt_wrapper .table tfoot th {
    background-color: var(--ryd-surface-inner);
    border-top: 1px solid var(--ryd-border);
}

html:not([data-theme="dark"]) #kt_wrapper .dataTables_wrapper .dataTables_info,
html:not([data-theme="dark"]) #kt_wrapper .dataTables_wrapper .dataTables_length label,
html:not([data-theme="dark"]) #kt_wrapper .dataTables_wrapper .dataTables_paginate {
    color: var(--ryd-text-muted);
}

html:not([data-theme="dark"]) #kt_wrapper .dataTables_empty {
    color: var(--ryd-text-muted);
}

/* Solicitar entregador — checkboxes com contorno visível */
#form_trip_request .form-check-custom.form-check-solid .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.1rem;
    border: 2px solid #7e8299 !important;
    background-color: #fff !important;
    cursor: pointer;
}

#form_trip_request .form-check-custom.form-check-solid .form-check-input:hover {
    border-color: #FF8800 !important;
}

#form_trip_request .form-check-custom.form-check-solid .form-check-input:focus {
    border-color: #FF8800 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 136, 0, 0.25) !important;
}

#form_trip_request .form-check-custom.form-check-solid .form-check-input:checked {
    background-color: #FF8800 !important;
    border-color: #e67a00 !important;
}

#form_trip_request .form-check-label {
    color: #3f4254;
    font-weight: 500;
    padding-left: 0.35rem;
}

#form_trip_request .form-check-input:checked + .form-check-label {
    color: #181c32;
    font-weight: 600;
}

/* Imediato / Agendado */
#form_trip_request .trip-request-schedule {
    background-color: var(--ryd-surface-muted, #dce0e7);
    padding: 0.35rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(24, 28, 50, 0.12);
    gap: 0.35rem;
}

#form_trip_request .trip-request-schedule-btn {
    width: 100%;
    font-weight: 600;
    font-size: 0.925rem;
    border: 2px solid rgba(255, 136, 0, 0.5);
    color: #b35f00;
    background-color: #fff;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#form_trip_request .btn-check:checked + .trip-request-schedule-btn {
    color: #fff !important;
    background-color: #FF8800 !important;
    border-color: #e67a00 !important;
    box-shadow: 0 2px 8px rgba(255, 136, 0, 0.35);
}

#form_trip_request .btn-check:not(:checked) + .trip-request-schedule-btn:hover {
    color: #9a5200;
    background-color: #fff8f0;
    border-color: #FF8800;
}

#form_trip_request .btn-check:focus-visible + .trip-request-schedule-btn {
    box-shadow: 0 0 0 0.2rem rgba(255, 136, 0, 0.35);
}