/* ========================================================
   OZPro ERP - Estilos da Visão 360° do Motoboy
   assets/css/motoboy-360.css
   ======================================================== */

.mb360-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.mb360-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mb360-modal {
    background: var(--bg-surface, #111827);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    width: 100%;
    max-width: 1050px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.15);
    transform: scale(0.96) translateY(12px);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.mb360-overlay.active .mb360-modal {
    transform: scale(1) translateY(0);
}

/* ── HEADER DO MOTOBOY ───────────────────────────────── */
.mb360-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.mb360-profile-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mb360-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.mb360-title-area h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-heading, #fff);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mb360-meta-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.mb360-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--bg-card, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    font-size: 11.5px;
    font-weight: 600;
}

.mb360-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mb360-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: var(--text-secondary, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.18s ease;
}

.mb360-close-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ── BARRA DE SELEÇÃO DE PERÍODO & DIA ────────────────── */
.mb360-date-toolbar {
    padding: 12px 24px;
    background: var(--bg-card, rgba(255, 255, 255, 0.02));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mb360-period-pills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface, rgba(0, 0, 0, 0.2));
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.mb360-period-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mb360-period-btn:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.06);
}

.mb360-period-btn.active {
    background: var(--accent, #6366f1);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.mb360-custom-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mb360-custom-date input[type="date"] {
    background: var(--bg-surface, rgba(0, 0, 0, 0.3));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    color: var(--text-primary, #fff);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    outline: none;
    color-scheme: dark;
}

/* ── CARDS DE RESUMO FINANCEIRO DO DIA ───────────────── */
.mb360-financial-grid {
    padding: 16px 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: var(--bg-surface, #111827);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.mb360-stat-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.mb360-stat-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.mb360-stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mb360-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-heading, #fff);
    line-height: 1.1;
    font-family: var(--font-mono, monospace);
}

.mb360-stat-sub {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    margin-top: 5px;
}

/* Card especial de Saldo / Acerto */
.mb360-balance-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.04) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.mb360-balance-card.debt {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.04) 100%);
    border-color: rgba(239, 68, 68, 0.25);
}

.mb360-balance-card.settled {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(79, 70, 229, 0.04) 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

/* ── ABAS DE NAVEGAÇÃO ───────────────────────────────── */
.mb360-tabs {
    padding: 0 24px;
    background: var(--bg-card, rgba(255, 255, 255, 0.02));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.mb360-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.mb360-tab-btn:hover {
    color: var(--text-primary, #fff);
}

.mb360-tab-btn.active {
    color: var(--accent, #6366f1);
    border-bottom-color: var(--accent, #6366f1);
}

.mb360-tab-badge {
    background: rgba(99, 102, 241, 0.18);
    color: var(--accent, #6366f1);
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}

/* ── CONTEÚDO SCROLLÁVEL DO MODAL ────────────────────── */
.mb360-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--bg-surface, #111827);
}

/* ── CARDS DE ENTREGA NA TIMELINE ────────────────────── */
.mb360-deliveries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mb360-delivery-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    transition: all 0.18s ease;
}

.mb360-delivery-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.mb360-del-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 260px;
}

.mb360-del-index {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.mb360-del-info h4 {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mb360-del-address {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.mb360-del-finance {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mb360-del-fin-box {
    text-align: right;
}

.mb360-del-fin-label {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    font-weight: 700;
}

.mb360-del-fin-val {
    font-size: 14px;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    color: var(--text-primary, #fff);
}

.mb360-del-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── MAPA DO CIRCUITO DIÁRIO ─────────────────────────── */
.mb360-map-wrapper {
    width: 100%;
    height: 480px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

#mb360MapContainer {
    width: 100%;
    height: 100%;
    background: #0d1322;
}

/* ── MODAL FOOTER ────────────────────────────────────── */
.mb360-footer {
    padding: 14px 24px;
    background: var(--bg-card, rgba(255, 255, 255, 0.02));
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── RESPONSIVO (MOBILE) ─────────────────────────────── */
@media (max-width: 768px) {
    .mb360-modal {
        max-height: 98vh;
        border-radius: 14px;
    }
    .mb360-header {
        padding: 14px 16px;
    }
    .mb360-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    .mb360-financial-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px 16px;
        gap: 8px;
    }
    .mb360-stat-value {
        font-size: 18px;
    }
    .mb360-content {
        padding: 14px 16px;
    }
    .mb360-delivery-card {
        flex-direction: column;
        align-items: stretch;
    }
    .mb360-del-finance {
        justify-content: space-between;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 10px;
    }
    .mb360-del-fin-box {
        text-align: left;
    }
    .mb360-del-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .mb360-map-wrapper {
        height: 360px;
    }
}
