/* OZPro ERP - Estilos do Modal de Rotas, Mapas e Entregas */
.drm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: drmFadeIn 0.2s ease-out;
}

@keyframes drmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.drm-modal {
    background: var(--bg-card, #0f172a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 35px var(--accent-glow, rgba(99, 102, 241, 0.2));
}

.drm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: var(--bg-surface, #1e293b);
}

.drm-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drm-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.drm-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading, #fff);
}

.drm-header-sub {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}

.drm-close {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.drm-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.drm-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Painel de Origem e Destino */
.drm-route-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 700px) {
    .drm-route-grid {
        grid-template-columns: 1fr;
    }
}

.drm-box {
    background: var(--bg-surface, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 14px 16px;
    position: relative;
}

.drm-box-origin {
    border-left: 3px solid #10b981;
}

.drm-box-dest {
    border-left: 3px solid #f59e0b;
}

.drm-box-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.drm-box-origin .drm-box-label { color: #10b981; }
.drm-box-dest .drm-box-label { color: #f59e0b; }

.drm-box-address {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.4;
    word-break: break-word;
}

.drm-box-ref {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
    font-style: italic;
}

/* Área do Mapa */
.drm-map-wrapper {
    position: relative;
    width: 100%;
    height: 310px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: #0f172a;
}

#drmMapContainer {
    width: 100%;
    height: 100%;
}

.drm-map-overlay-stats {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px 12px;
}

.drm-stat-item {
    font-size: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
}

.drm-stat-item b {
    color: #f59e0b;
}

/* Botões de Ação de Rota */
.drm-actions-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.drm-btn-nav {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
}

.drm-btn-gmaps {
    background: #1a73e8;
    color: #fff;
}
.drm-btn-gmaps:hover {
    background: #1557b0;
    transform: translateY(-1px);
}

.drm-btn-waze {
    background: #33ccff;
    color: #0b2238;
}
.drm-btn-waze:hover {
    background: #00bfff;
    transform: translateY(-1px);
}

.drm-btn-wpp {
    background: #25d366;
    color: #fff;
}
.drm-btn-wpp:hover {
    background: #1da851;
    transform: translateY(-1px);
}

.drm-btn-copy {
    background: var(--bg-surface, #1e293b);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
}
.drm-btn-copy:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Painel de Motoboy */
.drm-motoboy-dispatch {
    background: var(--bg-surface, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.drm-motoboy-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drm-motoboy-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.drm-motoboy-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Histórico de Rotas do Cliente */
.drm-history-section {
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    padding-top: 16px;
}

.drm-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.drm-history-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}

.drm-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.drm-history-item {
    background: var(--bg-surface, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: border-color 0.15s;
}

.drm-history-item:hover {
    border-color: var(--accent, #6366f1);
}

.drm-history-item-left {
    flex: 1;
    min-width: 0;
}

.drm-history-item-addr {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drm-history-item-meta {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}

.drm-history-item-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent, #6366f1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.drm-history-item-btn:hover {
    background: var(--accent, #6366f1);
    color: #fff;
}

/* Banner de rota rápida no PDV */
.pdv-quick-route-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: drmFadeIn 0.2s ease-out;
}

.pdv-quick-route-text {
    font-size: 12px;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.3;
}

.pdv-quick-route-btn {
    padding: 6px 12px;
    border-radius: 8px;
    background: #f59e0b;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
}

.pdv-quick-route-btn:hover {
    background: #d97706;
    color: #fff;
}

/* Seletor de Múltiplos Endereços no Modal de Rota */
.drm-address-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}
.drm-addr-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-muted, #94a3b8);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.drm-addr-chip:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #f59e0b;
}
.drm-addr-chip.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #000;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* Seletor de Endereços do Cliente no PDV */
.pdv-addr-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.pdv-addr-chip {
    background: var(--bg-surface, var(--bg-card, #1e293b));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    color: var(--text-secondary, #cbd5e1);
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 11px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pdv-addr-chip:hover {
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}
.pdv-addr-chip.active {
    background: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.pdv-addr-chip-new {
    border-style: dashed;
    color: var(--accent, #6366f1);
    background: rgba(99, 102, 241, 0.05);
}

